package com.tanhan.mindapp.dao;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tanhan.mindapp.dao.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.Date;

@Data
@TableName("sys_login_log")
@Schema(description = "系统登录日志实体类")
public class SysLoginLog extends BaseEntity {
    private static final long serialVersionUID = 1L;

    // 用户账号
    @TableField("user_name")
    @Schema(description = "用户账号", example = "admin")
    private String userName;

    // 登录IP地址
    @TableField("ip_address")
    @Schema(description = "登录IP地址", example = "192.168.1.100")
    private String ipAddress;

    // 登录地点
    @TableField("login_location")
    @Schema(description = "登录地点", example = "北京")
    private String loginLocation;

    // 浏览器类型
    @TableField("browser")
    @Schema(description = "浏览器类型", example = "Chrome")
    private String browser;

    // 操作系统
    @TableField("os")
    @Schema(description = "操作系统", example = "Windows 10")
    private String os;

    // 登录状态（0成功 1失败）
    @TableField("status")
    @Schema(description = "登录状态", example = "0", allowableValues = {"0", "1"})
    private String status;

    // 提示消息
    @TableField("msg")
    @Schema(description = "提示消息", example = "登录成功")
    private String msg;

    // 访问时间
    @TableField("login_time")
    @Schema(description = "访问时间", example = "2023-01-01 12:00:00")
    private Date loginTime;
}
